﻿namespace TheSafety
{
    using System;
    using System.Runtime.InteropServices;

    public class OSDetector
    {
        public static bool a()
        {
            bool flag;
            return ((IntPtr.Size == 8) || ((a("kernel32.dll", "IsWow64Process") && IsWow64Process(GetCurrentProcess(), out flag)) && flag));
        }

        private static bool a(string A_0, string A_1)
        {
            IntPtr moduleHandle = GetModuleHandle(A_0);
            if (moduleHandle == IntPtr.Zero)
            {
                return false;
            }
            return (GetProcAddress(moduleHandle, A_1) != IntPtr.Zero);
        }

        [DllImport("kernel32.dll")]
        private static extern IntPtr GetCurrentProcess();
        [DllImport("kernel32.dll", CharSet=CharSet.Auto)]
        private static extern IntPtr GetModuleHandle(string A_0);
        [DllImport("kernel32", CharSet=CharSet.Auto, SetLastError=true)]
        private static extern IntPtr GetProcAddress(IntPtr A_0, [MarshalAs(UnmanagedType.LPStr)] string A_1);
        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)]
        private static extern bool IsWow64Process(IntPtr A_0, out bool A_1);
    }
}

